package crudfx.field;
import javax.swing.*;
import javafx.scene.paint.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class ArtLabel extends StandardLabel{
    public var color:Color=Color.web("#000000") on replace{
        jLabel.setForeground(new java.awt.Color(color.red,color.green,color.blue,color.opacity));
        };
    public var background:Color=Color.web("#000000",0.01) on replace{
        jLabel.setBackground(new java.awt.Color(background.red,background.green,background.blue,background.opacity));
        };
    public-init var bold:Boolean=false;
    public-init var italic:Boolean=false;
    public-init var serifs:Boolean=false;
    public-init var monospaced:Boolean=false;
    public-init var size:Number=9;
    init{
        jLabel.setForeground(new java.awt.Color(color.red,color.green,color.blue,color.opacity));
        jLabel.setBackground(new java.awt.Color(background.red,background.green,background.blue,background.opacity));
        var fn:String="SansSerif";
        if(monospaced)fn="Monospaced";
        if(serifs)fn="Serif";
        var fst:Integer=0;
        if(bold)fst=fst+java.awt.Font.BOLD;
        if(italic)fst=fst+java.awt.Font.ITALIC;
        var font:java.awt.Font=new java.awt.Font(fn,fst,size);
        jLabel.setFont(font);
        jLabel.setOpaque(true);
        }
    override public function getJComponent():JComponent{
        return jLabel;
        }
}

